//
//  FXTSectionView.m
//  OfferJob
//
//  Created by 郑州动力无限科技 on 2017/7/5.
//  Copyright © 2017年 郑州动力无限科技. All rights reserved.
//

#import "FXTSectionView.h"
@interface FXTSectionView()
@property (nonatomic,strong)UILabel * titleLabel;
@property (nonatomic,strong)UILabel * infoLabel;
@property (nonatomic,strong)UIImageView * headImage;
@end
@implementation FXTSectionView
-(UILabel *)titleLabel{
    if (!_titleLabel) {
        _titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(self.headImage.frame)+10,CGRectGetMinY(self.headImage.frame)-15, 100, 30)];
        _titleLabel.font = [UIFont systemFontOfSize:16];
        _titleLabel.textColor = [UIColor blackColor];
        _titleLabel.textAlignment = NSTextAlignmentLeft;
        _titleLabel.text = self.sectionTitle;
    }return _titleLabel;
}

-(UILabel *)infoLabel{
    if (!_infoLabel) {
        _infoLabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMinX(self.titleLabel.frame),CGRectGetMaxY(self.titleLabel.frame), 140, 30)];
        _infoLabel.font = [UIFont systemFontOfSize:13*kAppScale];
        _infoLabel.textColor = RGBCOLOR(66, 66, 66);
        _infoLabel.textAlignment = NSTextAlignmentLeft;
        _infoLabel.numberOfLines = 0;
        _infoLabel.text =self.sectionInfo;
    }return _infoLabel;
}
-(UIImageView * )headImage{
    if (!_headImage) {
        _headImage = [[UIImageView alloc] initWithFrame:CGRectMake(15, CGRectGetHeight(self.frame)/2-24*kAppScale/2, 24*kAppScale, 24*kAppScale)];
        [_headImage setImage:ImageNamed(self.sectionHeader)];
    }return _headImage;
}

- (void)drawRect:(CGRect)rect {
    // Drawing code
    [self addSubview:self.headImage];
    [self addSubview:self.titleLabel];
    [self addSubview:self.infoLabel];
}
@end
